package com.cyan.app.workflow;

import android.text.TextUtils;

public class AppData {

    private static final AppData singleInstance = new AppData();
    /**
     * APP版本
     */
    public static String APPVERSION = "1.0.0";

    /**
     * APP版本号
     */
    public static int APPVERSIONCODE = 0;

    /**
     * 设备号
     */
    public static String UUID = "";

    /**
     * 屏蔽宽度
     */
    private int mScreenWidth;

    /**
     * 屏蔽高度
     */
    private int mScreenHeight;

    /**
     * 用户名
     */
    private String userName = "";

    /**
     * 用户ID
     */
    private String userId = "";

    /**
     * 用户TOKEN
     */
    private String userToken = "";

    /**
     * 用户类型
     */
    private String userType = "";
    /**
     * 用户头像
     */
    private String userface = "";
    /**
     * 昵称
     */
    private String nickname = "";
    /**
     * 手机号
     */
    private String mobile = "";

    private String connectstring="";

    public static AppData getInstance() {
        return singleInstance;
    }

    public static String getAPPVERSION() {
        return APPVERSION;
    }

    public static void setAPPVERSION(String APPVERSION) {
        AppData.APPVERSION = APPVERSION;
    }

    public static int getAPPVERSIONCODE() {
        return APPVERSIONCODE;
    }

    public static void setAPPVERSIONCODE(int APPVERSIONCODE) {
        AppData.APPVERSIONCODE = APPVERSIONCODE;
    }

    public int getScreenWidth() {
        return mScreenWidth;
    }

    public void setScreenWidth(int mScreenWidth) {
        this.mScreenWidth = mScreenWidth;
    }

    public int getScreenHeight() {
        return mScreenHeight;
    }

    public void setScreenHeight(int mScreenHeight) {
        this.mScreenHeight = mScreenHeight;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getUserface() {
        return userface;
    }

    public void setUserface(String userface) {
        this.userface = userface;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getUserToken() {
        return userToken;
    }

    public void setUserToken(String userToken) {
        this.userToken = userToken;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getConnectstring() {
        return connectstring;
    }

    public void setConnectstring(String connect) {
        this.connectstring = connect;
    }

    /**
     * 获取用户登录状态
     *
     * @return true-登录 false未登录
     */
    public boolean isUserLogin() {
        return (TextUtils.isEmpty(userId) || TextUtils.isEmpty(userName)) ? false : true;
    }

    public void clear() {
        this.userId = "";
        this.userName = "";
        this.userToken = "";
        this.userType = "";
        this.userface = "";
        this.nickname = "";
        this.connectstring ="";
    }
}